# server.py
import socket

server = socket.socket()
host = socket.gethostname()
server.bind((host, 8999))
server.listen(5)
print("The Server is running now...")
s, addr = server.accept()
print("connect addr:{}".format(addr))
while True:
    content = s.recv(1024)
    if str(content, encoding="utf-8") == " ":
        break
    print(str(content, encoding="utf-8"))
    s.send(content)
s.close()
